import { request } from '@/utils/request';
import CRUD from '@/utils/request/CRUD';

// 施工列表详情-施工节点CRUD
export const engineeringStageListCRUD = CRUD('/system/engineering-stage');

// 施工列表详情-延期施工节点时间CRUD
export const engineeringStageTimeTempCRUD = CRUD('/system/stage-time-temp');

// 施工列表详情-施工节点确认完成
export function engineeringStageConfirmComplete(data: Record<string, any>) {
  return request.post({
    url: '/system/engineering-stage/confirm-complete',
    data,
  });
}
// 施工列表详情-施工节点配置施工班组
export function engineeringStageUpdateTeam(data: Record<string, any>) {
  return request.post({
    url: '/system/engineering-stage/update-team',
    data,
  });
}
// 施工列表详情-施工图片审核
export function engineeringStagePictureExamine(data: Record<string, any>) {
  return request.post({
    url: '/system/engineering-stage/engineering-stage-picture-examine',
    data,
  });
}

// 施工列表详情-施工图片重新上传
export function engineeringStageReUploadPicture(data: Record<string, any>) {
  return request.post({
    url: '/system/engineering-stage/re-upload-engineering-stage-picture',
    data,
  });
}

// 施工列表详情-材料进度CRUD
export const engineeringMaterialSpeedListCRUD = CRUD('/system/engineering-material-speed');

// 施工列表详情-材料进度确认完成
export function engineeringMaterialSpeedConfirmComplete(data: Record<string, any>) {
  return request.post({
    url: '/system/engineering-material-speed/confirm-complete',
    data,
  });
}

// 施工列表详情-洽商变更CRUD
export const discussLogListCRUD = CRUD('/system/discuss-log');

// 施工列表详情-验收单CRUD
export const inspectListCRUD = CRUD('/system/inspect');

// 施工列表详情-提交验收单
export function engineeringSubmitInspect(data: Record<string, any>) {
  return request.post({
    url: '/system/inspect/submit-inspect',
    data,
  });
}
// 施工列表详情-退回验收单
export function engineeringRejectInspect(data: Record<string, any>) {
  return request.post({
    url: '/system/inspect/reject-inspect',
    data,
  });
}

// 施工列表详情-确认验收单
export function engineeringConfirmInspect(data: Record<string, any>) {
  return request.post({
    url: '/system/inspect/confirm-inspect',
    data,
  });
}

// 施工节点-阶段延期
export function engineeringStageExtensionApply(data: Record<string, any>) {
  return request.post({
    url: '/system/engineering-stage/stage-extension-apply',
    data,
  });
}
// 施工节点-合同延期
export function engineeringContractExtensionApply(data: Record<string, any>) {
  return request.post({
    url: '/system/engineering/contract-extension-apply',
    data,
  });
}
// 施工列表详情-延期单CRUD
export const engineeringContractYanqiCRUD = CRUD('/system/contract-yanqi-file');
// 施工列表详情-设计信息CRUD
export const orderFileListCRUD = CRUD('/system/order-file');

// 施工节点-合同-保存实际时间
export function engineeringContractUpdateActualTime(data: Record<string, any>) {
  return request.post({
    url: '/system/order-contract-zheng/update-actual-time',
    data,
  });
}

// 施工列表详情-施工放样CRUD
export const systemLoftingListCRUD = CRUD('/system/lofting');

// 查询结算
export function getSettlement(params: Record<string, any>) {
  return request.get({
    url: '/system/settlement-order/query-settlement',
    params,
  });
}

// 保存结算信息
export function saveSettlement(data: Record<string, any>) {
  return request.post({
    url: '/system/settlement-order/save-settlement',
    data,
  });
}